package com.honeywen.mymvc.wheel;

import com.google.common.collect.Lists;

import java.util.List;

/**
 * 女的微信 NY86627 8171
 * lynn121355
 * @author wangwei
 * @date 2019/4/11
 */
public class Test2 {

    static int r = 707829217;


    public static boolean isPrime(int num) {

        for (int i = 2; i < num; i++) {
            if (num % i == 0) {
                return false;
            }

        }
        return true;

    }


    public static void main(String[] args) {


        for (int i = 2; i < r; i++) {
            boolean flag = true;

            for (int j = 2; j < i; j++) {
                if (i % j == 0) {
                    flag = false;
                    break;
                }

            }

            // 如果是素数
            if (flag) {

                if (r % i == 0) {
                    int x = r / i;
                    // 判断 x是否为素数
                    if (isPrime(x)) {
                        System.out.println("找到了，是 " + i + "  " + x);
                        break;
                    }
                }


            }


        }


        System.out.println("------");

        int count = 0;
        // 866278171
        for (int i = 1; i <= 866278171; i++) {
            if (i % 2 == 0) {
                continue;
            }

            String str = String.valueOf(i);
            if (!str.contains("3")) {
                continue;
            }
            for (int j = 0; j < str.length(); j++) {
                if (String.valueOf("3").equals(String.valueOf(str.charAt(j)))) {
                    count++;
                }

            }

        }
        System.out.println(count);


    }
}
